<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>调整会员推荐关系</title>
<link href="__PUBLIC__/admin/css/xc.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/css/xc.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.js"></script> 
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.admin.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/common-1.0.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/layer/layer.js"></script>
</head>
<body>
<div class="pd-20">
  <form action="" method="post" class="form form-horizontal" id="myform">
    <div class="row cl">
      <label class="form-label col-3"><span class="c-red">*</span>会员信息：</label>
      <div class="formControls col-6">
        <input type="text" id="uid" class="input-text" onBlur="getUname('uid')" placeholder="请输入修改会员ID或手机号">
      </div>
      <input type="hidden" id="uidval" name="uidval">
      <div class="col-3 pt-3" id="uidtishi"></div>
    </div>
    <!--<div class="row cl">-->
      <!--<label class="form-label col-3"><span class="c-red">*</span>新推荐人：</label>-->
      <!--<div class="formControls col-6">-->
        <!--<input type="text" id="pid" class="input-text" onBlur="getUname('pid')" placeholder="请输入新推荐会员的ID或手机号">-->
      <!--</div>-->
      <!--<input type="hidden" id="pidval" name="pidval">-->
      <!--<div class="col-3 pt-3" id="pidtishi"></div>-->
    <!--</div>-->
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>新节点人：</label>
			<div class="formControls col-6">
				<input type="text" id="lid" class="input-text" name="lid" placeholder="请输入节点人的VIP ID">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>左右区：</label>
			<div class="formControls col-6">
				<input type="text" id="place" class="input-text"  name="place" placeholder="左区为1 右区为2">
			</div>
		</div>
    <div class="row cl">
      <label class="form-label col-3"></label>
      <div class="formControls col-6">
        <input type="checkbox" id="check"><span style="vertical-align: top; padding-left:0.2rem; color:#f00">确认调整推荐关系</span>
      </div>
    </div>
    <div class="row cl">
      <div class="col-9 col-offset-3">
        <button type="button" id="sub" name="sub" class="btn btn-primary radius" onClick="checkSubmit()"><i class='Hui-iconfont'>&#xe632;</i> 保存</button>
        <button class="btn btn-default radius" type="button" onClick="layer_close();"><i class='Hui-iconfont'>&#xe66b;</i> 取消</button>
      </div>
    </div>
  </form>
</div>
<script type="text/javascript">
//按回车件触发提交
document.onkeydown=function(event){
	var e = event || window.event || arguments.callee.caller.arguments[0];
	if(e && e.keyCode==13){ // enter 键
		checkSubmit();
	}
}; 
//提交数据
function checkSubmit()
{
	var uid = $.trim($('#uidval').val());
	var lid = $.trim($('#lid').val());
	var place = $.trim($('#place').val());
	var che = $("input[type='checkbox']").is(':checked');
	if(uid == ''){
		layer.msg('会员信息不能为空', {icon: 2});
		return false;
	}if(lid == ''){
	layer.msg('新节点人信息不能为空!', {icon: 2});
	return false;
}if(place == ''){
	layer.msg('左右区信息不能为空!', {icon: 2});
	return false;
}if(che==false){
		layer.msg('请确认调整会员推荐关系!', {icon: 2});
		return false;
	}
	$.ajax({
		type : 'post',
		url : '__MODULE__/User/upTeamRecoms',
		data : $("#myform").serialize(),
		dataType : 'json',
		success : function(res){
			if(res.status == 1){
				layer.msg(res.msg,{icon:1,time:2000},function(){
					// 先获取窗口索引，才能关闭窗口  
					var index = parent.layer.getFrameIndex(window.name);
					parent.layer.close(index);
				});
				parent.call_back_fun('success');
			}else{
				layer.msg(res.msg, {icon: 2});
			}
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			layer.alert('网络失败，请刷新页面后重试',{icon:2});
		}
	})
}
</script>
</body>
</html>